<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCWeb.Models.Content>" %>

<%@ Register Src="~/Views/Menu/MainMenu.ascx" TagName="MainMenu" TagPrefix="mmuc" %>
<%@ Register Src="~/Views/Shared/LogOnUserControl.ascx" TagName="LogOnUserControl" TagPrefix="louc" %>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <title>Admin: Staffs</title>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <script language="javascript" type="text/javascript">
        function ChangeStatus(id, name, status) {
            var s = 'active';
            if (status.toString() == "True") {
                s = 'deactive';
            }
            if (confirm("Are you sure that this news: " + name + " will be " + s + "?")) {
                // Perform change status.
                var action = '<%= Url.Action("ChangeStatus", "News") %>/' + id;
                var request = new Sys.Net.WebRequest();
                request.set_httpVerb("POST");
                request.set_url(action);
                request.add_completed(ChangeStatusCompleted);
                request.invoke();
            }
        }

        function ChangeStatusCompleted() {
            // Reload page  
            window.location.reload();
        }    
    </script>

    <louc:LogOnUserControl ID="LogOnUserControl1" runat="server" />
    <!-- BEGIN: MainMenu -->
    <mmuc:MainMenu ID="MainMenu1" runat="server" />
    <!-- END: MainMenu -->
    <br />
    <h2>
        Admin: Staff
    </h2>
    <hr />
    <p>
        ID:
        <%= Html.Encode(Model.ID) %>
    </p>
    <p>
        CompanyId:
        <%= Html.Encode(Model.CompanyId) %>
    </p>
    <p>
        CommunityId:
        <%= Html.Encode(Model.CommunityId) %>
    </p>
    <p>
        Title:
        <%= Html.Encode(Model.Title) %>
    </p>
    <p>
        Body:
        <%= Html.Encode(Model.Body) %>
    </p>
    <p>
        Active:
        <%= Html.Encode(Model.Active) %>
    </p>
    <p>
        ContentType:
        <%= Html.Encode(Model.ContentType) %>
    </p>
    <p>
        <%= Html.ActionLink("Create community news", "Create", new {communityId=Request.QueryString["CommunityId"]})%>
        |
        <%= Html.ActionLink("Create " + ConfigurationManager.AppSettings["SiteName2"] + " news", "CreateLeisureLifeNews", new {communityId=Request.QueryString["CommunityId"]})%>
    </p>
</asp:Content>
